﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;


[Serializable]
public class TopicDM
{
    public List<TopicItemDM> topicItemDMs;
    public int TopicItemIndex = 0;
    public TopicDM()
    {
        topicItemDMs = new List<TopicItemDM>();
    }

    /// <summary>
    /// 根据标题获取索引
    /// </summary>
    /// <param name="Tytle"></param>
    public int GetIndex(string Tytle)
    {
        int tempIndex = 0;
        if (topicItemDMs!=null)
        {
            for (int i = 0; i < topicItemDMs.Count; i++)
            {
                if (topicItemDMs[i].TopicTytle == Tytle)
                {
                    tempIndex = i + 1;
                    return tempIndex;
                }
            }
        }
        return tempIndex;
    }

    /// <summary>
    /// 获取总题数
    /// </summary>
    /// <returns></returns>
    public int GetCount()
    {
        int Temp = 0;
        if (topicItemDMs!=null)
        {
            Temp = topicItemDMs.Count;
        }
        return Temp;
    }
}

[Serializable]
public class TopicItemDM
{
    public string TopicTytle;//题目
    public int MaxScore;    //最大分数
    public int Score;       //实际得分
    public bool Interactable = true;//锁定操作 是 ：可以修改 否：无法修改答案
    public bool IsTrue = false;
    public List<string> RealAnswerList;//正确答案
    public List<string> AnswerList;//所有答案
    public List<string> PlayAnswerList;//用户选择的答案

    public TopicItemDM()
    {
        RealAnswerList = new List<string>();
        PlayAnswerList = new List<string>();
        AnswerList = new List<string>();
    }
}